package com.tuanzi.loan.business.repository.receipt.statistics;

import com.tuanzi.loan.business.entity.receipt.statistics.ReceiptRechargeOrder;
import com.tuanzi.loan.business.repository.receipt.statistics.custom.ReceiptRechargeOrderRepositoryCustom;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Date;
import java.util.List;

public interface ReceiptRechargeOrderRepository extends ReceiptRechargeOrderRepositoryCustom, JpaRepository<ReceiptRechargeOrder,Long> {

    /**
     * 根据订单号查询借条充值订单
     * @param orderId 订单号
     * @return
     */
    ReceiptRechargeOrder findLoanReceiptRechargeOrderByOrderId(String orderId);

    List<ReceiptRechargeOrder> findByLoanReceiptSystemUserIdAndCreateTimeBetween(String userId, Date startTime, Date endTime);


    /**
     * 查询规定时间内某用户的某个订单订单状态列表
     * @param receiptUserId 借条用户id
     * @param orderStatus 订单状态
     * @param startTime 开始时间
     * @param endTime 结束时间
     * @return 充值订单列表
     */
    List<ReceiptRechargeOrder> findReceiptRechargeOrdersByLoanReceiptSystemUserIdAndOrderStatusAndPayTimeBetween(String receiptUserId, Integer orderStatus, Date startTime, Date endTime);

}
